﻿<!DOCTYPE html public "-//w3c//dtd html 4.01 transitional//en"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style type=text/css>
		body {
			font-size: 12px;
			color: #ffffff;
			font-family: 宋体
		}
		
		td {
			font-size: 12px;
			color: #ffffff;
			font-family: 宋体
		}
		</style>
		<script type="text/javascript"
			src="/static/javascript/jquery-1.7.2.js">
		</script>
		<script type="text/javascript"
			src="/static/javascript/jquery.messager.js">
		</script>
		<script type="text/javascript"
				src="../static/js/vue-3.2.4.global.js">
		</script>
		<script type="text/javascript"
				src="../static/js/axios-0.18.0.min.js">
		</script>
		<script type="text/javascript"
				src="../static/js/axios-helper.js">
		</script>
	</head>
	<body id="app">
		<form action="" method="post">
			<div>
				<table cellspacing=0 cellpadding=0 width=900 align=center border=0>
					<tbody>
						<tr>
							<td style="height: 105px">
								<img src="/static/images/login_11.gif" border=0>
							</td>
						</tr>
						<tr>
							<td background=/static/images/login_22.jpg height=300>
								<table height=300 cellpadding=0 width=900 border=0>
									<tbody>
										<tr>
											<td colspan=2 height=35></td>
										</tr>
										<tr>
											<td width=360></td>
											<td>
												<table cellspacing=0 cellpadding=2 border=0>
													<tbody>
														<tr>
															<td style="height: 28px" width=80>
																登 录 名：
															</td>
															<td style="height: 28px" width=150>
																<input id="uname" v-model="user.uname"  style="width: 130px"/>
															</td>
														</tr>
														<tr>
															<td style="height: 28px">
																登录密码：
															</td>
															<td style="height: 28px">
																<input id="upassword" v-model="user.upassword" style="width: 130px" type="password"/>
															</td>
														</tr>

														<tr>
															<td style="height: 18px"></td>
															<td style="height: 18px"></td>
															<td style="height: 18px"></td>
														</tr>
														<tr>

															<td>
																<input type="button" @click="dologin" value="登录" style="cursor: pointer;" />
															</td>
														</tr>
													</tbody>
												</table>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<img src="/static/images/login_33.jpg" border=0>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</form>
	</body>
	<script>
		var app = Vue.createApp({
			data(){
				return{
					user:{
						uname:"admin",
						upassword:"123456"
					}
				}
			},
			methods:{
				dologin(){
					console.log("user对象:",this.user);
					requestPost("/login",this.user).then((data)=>{
						console.log("****data",data);
						if(data.statusCode==1){
							sessionStorage.setItem("u",data.data.uname)
							// console.log("用户：",data.data)
							 window.location.href="/templates/success.html";
						}else
						{
							window.location.href="/templates/fail.html";
						}
					})
				}

			}
		}).mount("#app")

	</script>
</html>
